<?php

/**
 * 同步清单数据到es main_content
 */

use Biz\model\Album\AlbumListModel;
use Biz\service\Album\SyncEsMainContentService;

ini_set('display_errors', 1);
ini_set('memory_limit', -1); //不限制内存
ini_set("error_reporting", E_ALL);//显示所有错误

require_once '/data/wwwroot/g_vendor/autoload.php';

$data = AlbumListModel::selectByWhere(['status[!]' => AlbumListModel::STATUS_DELETE]);
foreach ($data as $val) {
    $albumId = $val['album_id'];
    if ($albumId) {
        $res = SyncEsMainContentService::syncAlbumToEsMainContent($albumId, $val);
        echo '$albumId:'.$albumId.';$res'.$res.'同步成功'.PHP_EOL;
    }
}
echo 'success'.PHP_EOL;

